package com.ruoyi.dataserver.api.dto;

import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;

import java.util.List;

/**
 * @ProjectName intelligent-city
 * @Package com.lab.dataserver.api.dto
 * @ClassName StatisticResultDTO
 * @Description 统计结果传输对象
 * @Company LAB
 * @Author LXK
 * @Date 2020/7/9 15:42
 * @UpdateUser
 * @UpdateDate
 * @UpdateRemark
 * @Version 1.0.0
 */
@Data
public class StatisticResultDTO {

  /**
   * totalCount: 总记录数
   */
  private Long totalCount = 0L;
  /**
   * totalLength: 总长度
   */
  @Setter(AccessLevel.NONE)
  private Double totalLength = Double.valueOf(0);
  /**
   * statisticsData : 统计数据集合
   */

  private List statisticsData;

  public void setTotalLength(Double totalLength) {
    double temp = Double.valueOf(0);
    if (totalLength != null && !totalLength.equals(temp)) {
      temp = Double.parseDouble(String.format("%.2f", totalLength));
    }
    this.totalLength = temp;
  }
}
